package com.china08.yxyapi.repository.db;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.china08.yxyapi.entity.db.huodong.YxyHuodongWeikeContestCatalogue;

public interface YxyHuodongWeikeContestCatalogueRepository
        extends JpaRepository<YxyHuodongWeikeContestCatalogue, String> {

    List<YxyHuodongWeikeContestCatalogue> findByUserIdAndIsApplyOrderByCreatedDateAsc(String userId, Boolean flag);

    List<YxyHuodongWeikeContestCatalogue> findByUserIdOrderByCreatedDateAsc(String userId);

    Integer countByBookContentIdAndIsApply(String bookContentId, Boolean flag);

    Integer countByBookContentIdAndUserIdAndIsApply(String bookContentId, String userId, Boolean flag);

    Integer countByBookContentIdAndUserId(String bookContentId, String userId);

}
